package com.jintian.smart.kernel.flowable.component.action.task;

import com.jintian.smart.kernel.core.flow.FlowAction;
import com.jintian.smart.kernel.core.flow.ProcessControl;
import com.jintian.smart.kernel.flowable.component.action.base.AbstractTaskAction;
import org.flowable.bpmn.model.UserTask;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskInfo;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * 作废
 */
@Component
public class AbortTaskAction extends AbstractTaskAction {
    @Override
    public FlowAction getAction() {
        return FlowAction.abortTask;
    }

    @Override
    protected List<TaskInfo> innerExecute(TaskEntity task, ProcessControl processControl) throws Exception {
        this.abortTask(task, processControl);
        return Collections.emptyList();
    }

    @Override
    public List<UserTask> queryTaskNextActivityNode(Task task) {
        return Collections.emptyList();
    }
}
